<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="common/include :: header('修改员工信息')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-appointment-edit" th:object="${employee}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">姓名：</label>
            <div class="col-sm-8">
                <input name="name" th:field="*{name}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">邮箱：</label>
            <div class="col-sm-8">
                <input name="email" th:field="*{email}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">年龄：</label>
            <div class="col-sm-8">
                <input name="age" th:field="*{age}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">入职时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="hiredate" th:value="${#dates.format(employee.hiredate, 'yyyy-MM-dd HH:mm')}" class="form-control" placeholder="yyyy-MM-dd HH:mm" type="text">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">所在部门：</label>
            <div class="col-sm-8">
                <select name="deptId" class="form-control m-b" th:with="type=${departments}">
                    <option th:each="dict : ${type}" th:text="${dict.name}" th:value="${dict.id}" th:field="*{deptId}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否超管：</label>
            <div class="col-sm-8">
                <select name="admin" class="form-control m-b" th:with="type=${@dict.getType('bus_employee_type')}">
                    <option th:each="dict : ${type}" th:text="${dict.label}" th:value="${dict.value}" th:field="*{admin}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否冻结：</label>
            <div class="col-sm-8">
                <select name="status" class="form-control m-b" th:with="type=${@dict.getType('bus_employee_type')}">
                    <option th:each="dict : ${type}" th:text="${dict.label}" th:value="${dict.value}" th:field="*{status}"></option>
                </select>
            </div>
        </div>
    </form>
</div>
<th:block th:include="common/include :: footer" />
<th:block th:include="common/include :: datetimepicker" />
<script th:inline="javascript">
    var prefix = ctx + "/business/employee";

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-appointment-edit').serialize());
        }
    }
    $("input[name='hiredate']").datetimepicker({
        format: "yyyy-mm-dd hh:ii",
        autoclose: true
    });
</script>
</body>
</html>